import { lazy } from "react";
// 一级路由
import Home from '../path/home/Index'
import Login from '../path/login/Index'
import Error from '../path/404/Index'
import { createBrowserRouter, Navigate } from "react-router-dom";
// 二级路由
let Order=lazy(()=>import('../path/order/Index'))
let User=lazy(()=>import('../path/user/Index'))
let Kuo=lazy(()=>import('../path/kuo/Index'))
// 三级路由
let Op=lazy(()=>import('../path/order/op/Index'))
export const menu_router=[
    {
        path:'/home/order',
        element:<Order></Order>,
        title:'设置管理',
        children:([
            {
                path:'/home/order/op',
                element:<Op></Op>,
                title:'用户管理'
            }
        ])
    },
    {
        path:'/home/user',
        element:<User></User>,
        title:'岗位管理'
    },
      {
        path:'/home/kuo',
        element:<Kuo></Kuo>,
        title:'扩展配置'
    },
    {
        path:'/home/kuo',
        element:<Kuo></Kuo>,
        title:'角色管理'
    },
     {
        path:'/home/kuo',
        element:<Kuo></Kuo>,
        title:'应用管理'
    },

]
const routes=createBrowserRouter([
{
    path:'/',
    element:<Navigate to={'/home'}></Navigate>
},
{
    path:'/home',
    element:<Home></Home>,
    children:menu_router
},
{
    path:'/login',
    element:<Login></Login>
},
{
    path:'*',
    element:<Error></Error>
}
])
export default routes